package com.kuzufang.modules.imageutil;

import android.app.Activity;
import android.content.Context;
import android.net.Uri;
import android.widget.ImageView;

import com.kuzufang.modules.imageutil.gilde.GlideApp;

import java.io.File;

/**
 * Created by songyuanjin on 2017/9/15.
 */

public class GlideImageLoader implements ImageLoader {

    @Override
    public void load(Context context, String imageUrl, ImageView imageView) {
        GlideApp.with(context)
                .load(imageUrl)
                .centerCrop()
                .into(imageView);
    }

    @Override
    public void load(Context context, Uri uri, ImageView imageView) {
        GlideApp.with(context)
                .load(uri)
                .centerCrop()
                .into(imageView);
    }

    @Override
    public void load(Context context, File file, ImageView imageView) {
        GlideApp.with(context)
                .load(file)
                .centerCrop()
                .into(imageView);
    }

    @Override
    public void load(Activity activity, String imageUrl, ImageView imageView) {
        GlideApp.with(activity)
                .load(imageUrl)
                .centerCrop()
                .into(imageView);
    }

    @Override
    public void load(Context context, int resId, ImageView imageView) {
        GlideApp.with(context)
                .load(resId)
                .centerCrop()
                .into(imageView);
    }
}
